package io.adrainty.bolee.security.models.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.adrainty.bolee.security.models.valobj.GrantTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>OAuthDTO</p>
 *
 * @author AdRainty
 * @version V1.0.0
 * @description OAuthDTO
 * @since 2025/8/1 10:59:19
 */

@Data
@Schema(description = "权限认证请求")
public class OAuthDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 6437982258082587022L;

    @JsonProperty("grant_type")
    @NotNull(message = "授权类型不能为空")
    @Schema(description = "授权类型", example = "password")
    private GrantTypeEnum grantType;

    @JsonProperty("client_id")
    @Schema(description = "Oauth2客户端ID", example = "operators-pc")
    private String clientId;

    @JsonProperty("client_secret")
    @Schema(description = "Oauth2客户端密钥", example = "pass")
    private String clientSecret;

    @Schema(description = "用户名", example = "admin")
    private String username;

    @Schema(description = "密码", example = "123456")
    private String password;

    @Schema(description = "手机号", example = "12345678901")
    private String mobile;

    @JsonProperty("userToken")
    @Schema(description = "用户Token", example = "12345678901")
    private String userToken;

    @JsonProperty("login_type")
    @Schema(description = "登录方式", example = "1")
    private Integer loginType;

    @Schema(description = "小程序code")
    private String code;

    @Schema(description = "验证码")
    private String verifyCode;

}
